package thread;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) throws IOException{
   /*     System.out.println("11");
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("222");
    }*/

//        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入数字:");
//        int i = scanner.nextInt();
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        String line=bufferedReader.readLine();
        int i = Integer.parseInt(line);
        if (i<=0){
            System.out.println("错了" );
            return;
        }
        System.out.println("计时开始:");
       while (i>=0){
           System.out.println(i);
           i--;
           try {
               Thread.sleep(1000);
           } catch (InterruptedException e) {
               e.printStackTrace();
           }
       }
   /*     for ( int i = scanner.nextInt();i>=0; i--) {
            System.out.println(i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }*/
    }
}
